/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nxlv2.nomad.accessdb.services;

import com.nxlv2.nomad.accessdb.dao.ITvaDao;
import com.nxlv2.nomad.accessdb.dao.jdbc.JdbcTvaDao;
import com.nxlv2.nomad.businessobjects.Tva;
import java.util.List;

/**
 *
 * @author Administrateur
 */
public class TvaServices {
    private static final ITvaDao dao = new JdbcTvaDao();

    /**
     * 
     * @param tva
     * @throws ServiceException 
     */
    public void create(Tva tva) throws ServiceException {
        dao.saveTva(tva);
    }
    
    /**
     * 
     * @param tva
     * @throws ServiceException 
     */
    public void update(Tva tva) throws ServiceException {
        dao.updateTva(tva);
    }
    
    /**
     * 
     * @param tva
     * @throws ServiceException 
     */
    public void delete(Tva tva) throws ServiceException {
        dao.deleteTva(tva.getIdAppli());
    }
    
    /**
     * 
     * @param id
     * @return Tva
     * @throws ServiceException 
     */
    public Tva get(int id) throws ServiceException {
        return dao.findById(id);
    }
    /**
     * 
     * @param userId
     * @return List<Tva>
     * @throws ServiceException 
     */
    public List<Tva> getTvaMaj(int userId) throws ServiceException {
        return dao.getTvaMaj(userId);
    }
}
